<?php 
header("Content-Type: text/javascript");
include("../../appg/settings.php");
include("../../appg/init_vanilla.php");
global $Context; 
?>
FCKConfig.EditorAreaCSS = FCKConfig.BasePath + '../../styles.css' ;
FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/<?=$Context->Configuration['FCKEDITOR_DEFAULT_SKIN'] ?>/' ;
FCKConfig.DefaultLanguage = '<?=$Context->Configuration['FCKEDITOR_DEFAULT_LANGUAGE'] ?>' ;
FCKConfig.ContentLangDirection	= '<?=$Context->Configuration['FCKEDITOR_LANGUAGE_DIRECTION'] ?>' ;
FCKConfig.DefaultLinkTarget = '<?=$Context->Configuration['FCKEDITOR_DEFAULT_LINK_TARGET'] ?>' ;
FCKConfig.StartupShowBlocks = <?=$Context->Configuration['FCKEDITOR_SHOW_BLOCKS'] ?> ;
FCKConfig.ImageUpload = <?=($Context->Session->UserID > 0) ? $Context->Configuration['FCKEDITOR_IMAGE'] : 'false' ?> ;
FCKConfig.ImageBrowser = <?=($Context->Session->UserID > 0) ? $Context->Configuration['FCKEDITOR_IMAGE']: 'false' ?> ;
FCKConfig.ImageDlgHideAdvanced = true;
FCKConfig.ImageUploadAllowedExtensions	= ".(<?=$Context->Configuration['FCKEDITOR_IMAGE_ALLOWED_EXTENSIONS']?>)$" ;		// empty for all
FCKConfig.ImageUploadDeniedExtensions	= "" ;	// empty for no one
FCKConfig.FlashUpload = <?=($Context->Session->UserID > 0) ? $Context->Configuration['FCKEDITOR_FLASH'] : 'false' ?> ;
FCKConfig.FlashBrowser = <?=($Context->Session->UserID > 0) ? $Context->Configuration['FCKEDITOR_FLASH'] : 'false' ?> ;
FCKConfig.FlashDlgHideAdvanced = true;
FCKConfig.FlashUploadAllowedExtensions	= ".(<?=$Context->Configuration['FCKEDITOR_FLASH_ALLOWED_EXTENSIONS']?>)$" ;		// empty for all
FCKConfig.FlashUploadDeniedExtensions	= "" ;
FCKConfig.LinkUpload = <?=($Context->Session->UserID > 0) ? $Context->Configuration['FCKEDITOR_LINK'] : 'false' ?> ;
FCKConfig.LinkBrowser = <?=($Context->Session->UserID > 0) ? $Context->Configuration['FCKEDITOR_LINK'] : 'false' ?> ;
FCKConfig.LinkDlgHideAdvanced = true;
FCKConfig.LinkUploadAllowedExtensions	= ".(<?=$Context->Configuration['FCKEDITOR_LINK_ALLOWED_EXTENSIONS']?>)$" ;		// empty for all
FCKConfig.LinkUploadDeniedExtensions	= "" ;	// empty for no one

FCKConfig.ToolbarCanCollapse = false ;
FCKConfig.EnterMode = '<?=$Context->Configuration['FCKEDITOR_ENTERMODE'] ?>' ;
FCKConfig.ShiftEnterMode = '<?=$Context->Configuration['FCKEDITOR_SHIFT_ENTERMODE'] ?>' ;
FCKConfig.Plugins.Add( 'autogrow' ) ;
FCKConfig.AutoGrowMax = 600 ;
<?=($Context->Configuration['FCKEDITOR_PLUGIN_VIDEO']=='true') ? 'FCKConfig.Plugins.Add( "Video","en");' : ''?>


/*
* Customize the toolbar
*/
FCKConfig.ToolbarSets["Vanilla"] = [
    ['Source','-','NewPage','Preview','Undo','Redo'],
    ['Bold','Italic','Underline','StrikeThrough'],
    ['RemoveFormat','Cut','Copy','Paste','PasteWord'],
    ['Style','FontFormat','FontName','FontSize','TextColor'],
    ['JustifyLeft','JustifyCenter','JustifyRight'],
    ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote'],
    //['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
    //['Table','-','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableCellProp'],
    ['Link','Unlink','-','Smiley','SpecialChar','Image','-','<?=($Context->Configuration['FCKEDITOR_PLUGIN_VIDEO']=='true') ? 'Video' : ''?>','-','FitWindow' ]
] ;
FCKConfig.ToolbarSets["Basic"] = [
    ['Bold','Italic','Underline'],
    ['Cut','Copy','Paste'],
    ['JustifyLeft','JustifyCenter','JustifyRight'],
    ['OrderedList','UnorderedList','-','Blockquote'],
    ['Link','Unlink','-','Smiley','Image','-','<?=($Context->Configuration['FCKEDITOR_PLUGIN_VIDEO']=='true') ? 'Video' : ''?>' ]
] ;

/**
 * Core styles.
 */
FCKConfig.CoreStyles.Bold			= { Element : 'span', Attributes : { 'class' : 'Bold' } } ;
FCKConfig.CoreStyles.Italic			= { Element : 'span', Attributes : { 'class' : 'Italic' } } ;
FCKConfig.CoreStyles.Underline		= { Element : 'span', Attributes : { 'class' : 'Underline' } } ;
FCKConfig.CoreStyles.StrikeThrough	= { Element : 'span', Attributes : { 'class' : 'StrikeThrough' } } ;
FCKConfig.FontFormats	= 'p;div;pre;address;h1;h2;h3;h4' ;

/**
 * Font face
 */
// List of fonts available in the toolbar combo. Each font definition is
// separated by a semi-colon (;). We are using class names here, so each font
// is defined by {Class Name}/{Combo Label}.
FCKConfig.FontNames = 'FontComic/Comic Sans MS;FontCourier/Courier New;FontTimes/Times New Roman' ;

// Define the way font elements will be applied to the document. The "span"
// element will be used. When a font is selected, the font name defined in the
// above list is passed to this definition with the name "Font", being it
// injected in the "class" attribute.
// We must also instruct the editor to replace span elements that are used to
// set the font (Overrides).
FCKConfig.CoreStyles.FontFace =
	{
		Element		: 'span',
		Attributes	: { 'class' : '#("Font")' },
		Overrides	: [ { Element : 'span', Attributes : { 'class' : /^Font(?:Comic|Courier|Times)$/ } } ]
	} ;

/**
 * Font sizes.
 */
FCKConfig.FontSizes		= 'FontSmaller/Smaller;FontLarger/Larger;FontSmall/8pt;FontBig/14pt;FontDouble/Double Size' ;
FCKConfig.CoreStyles.Size =
	{
		Element		: 'span',
		Attributes	: { 'class' : '#("Size")' },
		Overrides	: [ { Element : 'span', Attributes : { 'class' : /^Font(?:Smaller|Larger|Small|Big|Double)$/ } } ]
	} ;

/**
 * Font colors.
 */
FCKConfig.EnableMoreFontColors = false ;
FCKConfig.FontColors = 'ff9900/FontColor1,0066cc/FontColor2,ff0000/FontColor3' ;
FCKConfig.CoreStyles.Color =
	{
		Element		: 'span',
		Attributes	: { 'class' : '#("Color")' },
		Overrides	: [ { Element : 'span', Attributes : { 'class' : /^FontColor(?:1|2|3)$/ } } ]
	} ;

FCKConfig.CoreStyles.BackColor =
	{
		Element		: 'span',
		Attributes	: { 'class' : '#("Color")BG' },
		Overrides	: [ { Element : 'span', Attributes : { 'class' : /^FontColor(?:1|2|3)BG$/ } } ]
	} ;

/**
 * Indentation.
 */
FCKConfig.IndentClasses = [ 'Indent1', 'Indent2', 'Indent3' ] ;

/**
 * Paragraph justification.
 */
FCKConfig.JustifyClasses = [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull' ] ;

/**
 * Styles combo.
 */
FCKConfig.StylesXmlPath = '' ;
FCKConfig.CustomStyles =
	{
		'Computer Code' : { Element : 'code' },
		'Inserted Text' : { Element : 'ins' },
		'Cited Work' : { Element : 'cite' },
		'Language: RTL' :{ Element : 'bdo', Attributes : { 'dir' : 'rtl' }},
		'Language: LTR' :{ Element : 'bdo', Attributes : { 'dir' : 'ltr' }}
	} ;
